package cn.stylefeng.guns.modular.gridsystem.enums;

import cn.stylefeng.guns.core.annotion.ExpEnumType;
import cn.stylefeng.guns.core.exception.enums.abs.AbstractBaseExceptionEnum;
import cn.stylefeng.guns.core.factory.ExpEnumCodeFactory;
import cn.stylefeng.guns.modular.gridsystem.constants.BizExpEnumConstant;
import lombok.Getter;

/**
 * @author zxw 2022/12/17 17:10
 */
@Getter
@ExpEnumType(module = BizExpEnumConstant.GUNS_MAIN_MODULE_EXP_CODE, kind = BizExpEnumConstant.MATERIAL_EXCEPTION_ENUM)
public enum CollectionFaultExceptionEnum implements AbstractBaseExceptionEnum {

    /**
     * 网关不存在
     */
    GATEWAY_NOT_EXIST(1, "网关不存在");

    private final Integer code;

    private final String message;

    CollectionFaultExceptionEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return ExpEnumCodeFactory.getExpEnumCode(this.getClass(), code);
    }

    @Override
    public String getMessage() {
        return message;
    }
}
